import request from '@/utils/request'

/**
 * 路由定义（主进程与渲染进程通信频道定义）
 */
const ipcApiRoute = {
  // test: 'controller.example.test',
  // messageShow: 'controller.example.messageShow',
  // messageShowConfirm: 'controller.example.messageShowConfirm',
  // selectFolder: 'controller.example.selectFolder',
  // openDirectory: 'controller.example.openDirectory',
  // loadViewContent: 'controller.example.loadViewContent',
  // removeViewContent: 'controller.example.removeViewContent',
  // createWindow: 'controller.example.createWindow',
  // sendNotification: 'controller.example.sendNotification',
  // initPowerMonitor: 'controller.example.initPowerMonitor',
  // getScreen: 'controller.example.getScreen',
  // openSoftware: 'controller.example.openSoftware',
  // autoLaunch: 'controller.example.autoLaunch',
  // setTheme: 'controller.example.setTheme',
  // getTheme: 'controller.example.getTheme',
  // checkForUpdater: 'controller.example.checkForUpdater',
  // downloadApp: 'controller.example.downloadApp',
  // dbOperation: 'controller.example.dbOperation',
  // sqlitedbOperation: 'controller.example.sqlitedbOperation',
  // uploadFile: 'controller.example.uploadFile',
  // checkHttpServer: 'controller.example.checkHttpServer',
  // doHttpRequest: 'controller.example.doHttpRequest',
  // doSocketRequest: 'controller.example.doSocketRequest',
  // ipcInvokeMsg: 'controller.example.ipcInvokeMsg',
  // ipcSendSyncMsg: 'controller.example.ipcSendSyncMsg',
  // ipcSendMsg: 'controller.example.ipcSendMsg',
  // getWCid: 'controller.example.getWCid',
  // startJavaServer: 'controller.example.startJavaServer',
  // closeJavaServer: 'controller.example.closeJavaServer',
  // someJob: 'controller.example.someJob',
  // timerJobProgress: 'controller.example.timerJobProgress',
  // hello: 'controller.example.hello',


  checkHttpServer: 'controller.wallpaper.checkHttpServer',
  uploadFile: 'controller.wallpaper.uploadFile',
  getFiles: 'controller.wallpaper.getFiles'
}

/**
 * http表单上传-post
 * @param url
 * @param params
 */
const httpPostForm = (url: string, params: any) => {
  return request.postForm(url, params, {headers: {"Content-Type": "multipart/form-data"}})
}
/**
 * http get
 * @param url
 * @param params
 */
const httpGet = (url: string, params?: any) => {
  return request.get(url, params)
}

export {
  ipcApiRoute,
  httpPostForm,
  httpGet
}
